package com.springboot.common.methodInterceptor;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Author: TongRui乀
 * @Date: 2020/3/13 10:59
 * @description：
 */
@Slf4j
@Aspect
@Component
public class MethodInterceptorAdvice {


    @Pointcut("execution(* com.springboot.controller.*.*(..))")
    public void controller(){}


    @Before("controller()")
    public void before(JoinPoint joinPoint){

        log.info("前置通知");

    }

    @After("controller()")
    public void after(){
        log.info("后置通知");
    }
}
